package com.carmanage.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.carmanage.dao.IBusDao;
import com.carmanage.domain.Car;
import com.carmanage.util.PageController;


@Component
public class BusService {
	@Resource
	 private IBusDao iBusDao;

	public void setBusDao(IBusDao iBusDao) {
		this.iBusDao = iBusDao;
	}

	public IBusDao getBusDao() {
		return iBusDao;
	}
	
	
	public List<Object[]> getBrand() {
		List<Object[]> brand=iBusDao.getBrand();
		return brand;
	}

	

	public List<Object[]> getInsurance_date() {
		List<Object[]> insurance_date=iBusDao.getInsurance_date();
		return insurance_date;
	}

	public List<Object[]> getPlate() {
		List<Object[]> plate=iBusDao.getPlate();
		return plate;
	}

	public List<Object[]> getRegister_date() {
		List<Object[]> register_date=iBusDao.getRegister_date();
		return register_date;
	}

	public List<Object[]> getSeat() {
		List<Object[]> seat=iBusDao.getSeat();
		return seat;
	}

	public int getTotalRows() {
		int totalRow=iBusDao.getTotalRows();
		return totalRow;
	}

	public List<Car> groupSearch(Car bus, PageController pc) {
		List<Car> buses=iBusDao.groupSearch(bus, pc);
		return buses;
	}
	
	public void deleteBusByString(String plate) {
		iBusDao.deleteBusByString(plate);
     }
	
	public int getGroupTotalRows(Car bus) {
		int totalRow=iBusDao.getGroupTotalRows(bus);
		return totalRow;
	}

	public void save(Car bus) {
		iBusDao.save(bus);
     }

	public List<Car> showAllBuses(PageController pc) {
		List<Car> Buses=iBusDao.showAllBuses(pc);
		return Buses;
	}

	public Car showModifyData(String modifyBusPlate) {
		Car car=iBusDao.showModifyData(modifyBusPlate);
		return car;
	}
	
	public void modiCar(Car car){
		iBusDao.modiCar(car);
	}
}
